﻿@model Helper.Core.Entity.Call

@{
    Layout = "~/Views/Shared/_Layout.cshtml";
}
    <table style="width:100%">
        <tr>
            <th>
                <div class="display-label"><b>Assunto</b></div>
            </th>
            <th>
                <div class="display-label"><b>Criador</b></div>
            </th>
            <th>
                <div class="display-label"><b>Empresa</b></div>
            </th>
        </tr>
        <tr>
            <td>
                <div class="display-field">
                    @Html.DisplayFor(model => model.Subject)
                </div>
            </td>
            <td>
                <div class="display-field">
                    @Html.DisplayFor(model => model.Author.Name)
                </div>
            </td>
            <td>
                <div class="display-field">
                    @Html.DisplayFor(model => model.Author.ParentBusiness.Name)
                </div>
            </td>
        </tr>
    </table>

    <div class="display-label"><b>Conteúdo</b></div>
    <div class="display-field">
        @Html.TextAreaFor(model => model.Content, new { Disabled = true, Class = "Content-Call-Box" })
    </div>

    <div class="display-label"><b>Data da criação</b></div>
    <div class="display-field">
        @Html.DisplayFor(model => model.Timestamp)
    </div>

<hr />
    @Html.Partial("CreatePost", new Helper.Core.Entity.Post())
<hr />
  <fieldset>
    <legend>Postagens</legend>
    <table class="post-table">
    <tr>    
    <th id="idCol"></th>
    <th id="dateCol">Data</th>
    <th id="userCol">Usuário</th>
    <th>Conteúdo</th>
    </tr>

    @if (Model.Posts != null)
    {
        int i = 1;
        foreach (Helper.Core.Entity.Post item in Model.Posts)
        {
            <tr>
                <td>@i</td>
                <td>@item.Timestamp.ToString()</td>
                <td>@item.Author.Name</td>
                <td>@item.Content</td>                
            </tr>
            i++;
        }
    }
    
    </table>
  </fieldset>


<p>
    @Html.ActionLink("Back to List", "Index")
</p>
